#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int N = 14;
const double inf = 1e20;

int A, B, C, D;
double f[N][N][N][N][5][5];



double dp(int a, int b, int c, int d, int x, int y)
{

     
    double &v = f[a][b][c][d][x][y];

    if(v >= 0) return v;

    int sa = a + (x == 0) + (y == 0);
    int sb = b + (x == 1) + (y == 1);
    int sc = c + (x == 2) + (y == 2);
    int sd = d + (x == 3) + (y == 3);
    double sum = a + b + c + d + (x != 4) + (y != 4);
    sum = 54 - sum;
    
    if(sa >= A && sb >= B && sc >= C && sd >= D)  return v = 0;
    if(sum <= 0) return v = inf;
    


    v = 1;
    if (a < 13) v += (13.0 - a) / sum * dp(a + 1, b, c, d, x, y);
    if (b < 13) v += (13.0 - b) / sum * dp(a, b + 1, c, d, x, y);
    if (c < 13) v += (13.0 - c) / sum * dp(a, b, c + 1, d, x, y);
    if (d < 13) v += (13.0 - d) / sum * dp(a, b, c, d + 1, x, y);
    if (x == 4)
    {
        double t = inf;
        for (int i = 0; i < 4; i ++ ) t = min(t, 1.0 / sum * dp(a, b, c, d, i, y));
        v += t;
    }
    if (y == 4)
    {
        double t = inf;
        for (int i = 0; i < 4; i ++ ) t = min(t, 1.0 / sum * dp(a, b, c, d, x, i));
        v += t;
    }

    return v;
}

int main(){
#ifdef LOCALFLAG
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif


    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    memset(f, -1, sizeof f);

    scanf("%d%d%d%d", &A, &B, &C, &D);
    double t = dp(0, 0, 0, 0, 4, 4);

    if(t > inf / 2) printf("-1.000\n");
    else printf("%.3f", t);

    return 0;
}

